package com.tool.auto.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tool.auto.entity.Employee;
import com.tool.auto.mapper.EmployeeMapper;
import com.tool.auto.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 酒徒
 * @Version 1.0
 * @data 2024/1/23 17:50
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, Employee> implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    /**
     * 新建employee信息
     */
    @Override
    public void createEmployee() {
        Employee employee = Employee.builder()
                .name("测试")
                .username("ceshi")
                .password("123456")
                .phone("13512345678")
                .sex("1")
                .idNumber("111111111111111111")
                .status(1)
                .build();
        employeeMapper.insert(employee);
    }

    /**
     * 修改employee信息
     */
    @Override
    public void updateEmployee() {
        Employee employee = Employee.builder()
                .id(1749735442164031489L)
                .idNumber("777777777777777777")
                .status(0)
                .build();
        employeeMapper.updateById(employee);
    }
}
